mixin menu(items, selected)
	ul
		each item, i in items
			if item.subpage == selected
				li.selected
					a(href=item.url)
						span=item.text
			else
				li
					a(href=item.url)
						span=item.text

doctype 5
html
	head
		title= title

		if webfonts
			link(rel="stylesheet", href="http://fonts.googleapis.com/css?family=Roboto:200,300,400,600,700,200italic,300italic,400italic,600italic,700italic")
			link(rel="stylesheet", href="http://fonts.googleapis.com/css?family=Source+Code+Pro:200,300,400,500,600,700")

		link(rel='stylesheet', href='/css/style.css')

		link(rel="shortcut icon", type="image/x-icon", href="/images/favicon/mootools.ico")
		link(rel="icon", type="image/png", href="/images/favicon/mootools.png")

		meta(name="viewport",content="width=device-width, user-scalable=no")

		script(src='http://ajax.googleapis.com/ajax/libs/mootools/1.5.1/mootools-yui-compressed.js')
		script(src='/js/main.js')
		script.
			// Google Analytics
			(function(i, s, o, g, r, a, m){
				i['GoogleAnalyticsObject'] = r;
				i[r] = i[r] || function(){
					(i[r].q = i[r].q || []).push(arguments)
				}, i[r].l = 1 * new Date();
				a = s.createElement(o),
				m = s.getElementsByTagName(o)[0];
				a.async = 1;
				a.src = g;
				m.parentNode.insertBefore(a, m);
			})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

			//Kissmetrics
			var KM_KEY = "bdc37c96b302d1ae5030c63f81ebb0fead91601e";
			document.write(unescape("%3Cscript src='" + (("https:" == document.location.protocol) ? "https://s3.amazonaws.com/" : "http://") + "scripts.kissmetrics.com/t.js' type='text/javascript'%3E%3C/script%3E"));

		block scripts

	body(class=site)

		if site == 'mootools'
			header#header(role='banner')
				include ../partials/header
		else
			include ../partials/header

			hr

			header#header(role='banner')
				.clearfix.wrapper
					div
						h1
							block header-logo

						nav(role='navigation')
							h2.visually-hidden Menu
							block header-menu

		.main.clearfix(role='main')
			block main

			hr

			nav#menu(role='navigation')
				div.clearfix.wrapper
					include ../partials/projects

		hr

		footer#footer.clearfix.wrapper
			nav#sitemap(role='navigation')
				include ../partials/footer-navigation

			#credits(role='contentinfo')
				p
					a(href='/')
						img.mootools(src='/images/logo/mootools.png', alt='MooTools')
				p
					| Copyright © 2006-!{new Date().getFullYear()}
					br
					| Valerio Proietti & MooTools Developers
				p.mediatemple
					a(href='http://mediatemple.net')
						| Web Hosting by Media Temple
